const CracoLessPlugin = require("craco-less")
module.exports = {
    plugins: [
        { plugin: CracoLessPlugin }
    ],
    webpack: {
        configure: (webpackConfig, { env, paths }) => {
            webpackConfig.output = {
                library: `ReactApp`, //打包后项目名字ReactApp
                libraryTarget: 'umd', //打包格式，必须采用umd，qiankun才能加载
                // webpack 5 需要把 jsonpFunction 替换成 chunkLoadingGlobal
                chunkLoadingGlobal: `webpackJsonp_ReactApp`,
                globalObject: 'window'
            }
            return webpackConfig
        }
    },
    devServer: {
        //允许跨域问题
        headers: {
            'Access-Control-Allow-Origin': '*',
        },
        historyApiFallback: true,
        hot: false,
        // watchContentBase : false,
        liveReload: false
    }
}
